import { get,post } from '@/utils/index'

//获取推荐商品
export const getRecommandProducts = () => get('/public/getRecommandProducts')

//提交订单
export const handleOrders = (data={}) => post('/public/handleOrders', data)

//加入购物车
export const addToCarts = (data={}) => post('/product/addToCarts', data)

//获取购物车列表
export const getCarts = () => get('/public/getCarts')

export const getProducts = () => get('/public/getProducts')

export const buyProduct = (data={}) => post('/product/buyGoods', data)

//商品详细页面的详情获取，如尺码等
export const getSalePageProduct = (name:string) => get('/product/getProduct', {name:name})
//获取商品详情页的上方展示图片
export const getProductHeaderImg = (id:string) => get('/img/getProdectHeaderImg', {id:id})
//获取商品详情页的详细介绍图片
export const getProductDetailImg = (id:string) => get('/img/getProdectDetailImg', {id:id})

//搜索页面的搜索商品函数
export const getSearchPageProducts = (data = {}) => get('/product//getGoodsPage', data)

//获取搜索页面的品牌
export const getSearchPageBrands = (brandId:number) => get('/product/getBrands',{classId:brandId})